﻿function Pager(rowCount,pagesize,currentPage)
{


   this.currentPage = currentPage;
   
    if (!this.currentPage)
    {
        this.currentPage = 1;
        return;
    }
    this.maxPage = Math.ceil(parseFloat(rowCount) / parseFloat(pagesize));
    
    this.firstPage = 1;
    this.proviewPage = currentPage;
    this.nextPage = currentPage;
    if (this.proviewPage > 1)
    {
        this.proviewPage--;
    }
    if (this.nextPage < this.maxPage)
    {
        this.nextPage++;
    }
}

Pager.prototype.GetFirstPage = function ()
{

    return this.firstPage;
}
Pager.prototype.GetProviewPage = function ()
{
    return this.proviewPage;
}

Pager.prototype.GetNextPage = function ()
{

    return this.nextPage;
}

Pager.prototype.GetMaxPage = function ()
{

    return this.maxPage;

}

Pager.prototype.GetCurrentPage = function ()
{
    return this.currentPage;
}

Pager.prototype.SetCurrentPage=function(currentPage)
{
    this.currentPage = currentPage;
}

